/* two/src/components/GiftAnimation.css */
.gift-animation-container {
    position: fixed;
    top: 25%;
    left: 0;
    right: 0;
    width: 100%;
    height: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none; /* 让鼠标可以点击礼物下方的元素 */
    text-shadow: 0 0 5px #000;
}

/* 新增: 用于容纳粒子效果的画布 */
.gift-animation-container > canvas {
    position: absolute !important;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.gift-banner {
    background: linear-gradient(90deg, rgba(255,215,0,0.8) 0%, rgba(255,105,180,0.8) 100%);
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2; /* 确保在粒子效果之上 */
    animation: fadeInDown 0.3s ease-out, fadeOut 0.3s 1.5s forwards;
}

.gift-user {
    font-weight: bold;
}

.gift-name {
    font-weight: bold;
    color: #fff700;
}

.gift-image {
    max-width: 250px;
    max-height: 250px;
    position: relative;
    z-index: 2; /* 确保在粒子效果之上 */
}

/* --- 特效动画 --- */

/* 默认礼物动画 (更活泼的弹跳效果) */
.gift-image {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    will-change: transform, opacity;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55), fadeOut 0.4s 1.4s forwards;
}

/* 火箭的特殊动画 (曲线向上飞出，配合粒子) */
.gift-image.rocket {
    max-width: 200px;
    max-height: 200px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 30px #00eaff) drop-shadow(0 0 60px #fff) brightness(1.2) saturate(1.3);
    animation: rocketHoverAndFly 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* 皇冠的特殊动画 (增加闪耀效果) */
.gift-image.crown {
    max-width: 180px;
    max-height: 180px;
    filter: drop-shadow(0 0 15px gold);
    animation: dropAndSpin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55), glimmer 1.5s infinite;
}

/* 钻石的特殊动画 (增加旋转、闪烁和光泽感) */
.gift-image.diamond {
    max-width: 200px;
    max-height: 200px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 30px #00eaff) drop-shadow(0 0 60px #fff) brightness(1.2) saturate(1.3);
    animation: diamondAppear 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }
    60% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rocketHoverAndFly {
    0% {
        transform: translateY(100px) scale(0.5) rotate(-10deg);
        opacity: 0.2;
    }
    20% {
        transform: translateY(0px) scale(1.1) rotate(2deg);
        opacity: 1;
    }
    40% {
        transform: translateY(0px) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0.8) rotate(0deg);
        opacity: 0;
    }
}

@keyframes dropAndSpin {
    from {
        transform: translateY(-300%) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    to {
        transform: translateY(0) scale(1) rotate(720deg);
        opacity: 0;
    }
}

@keyframes glimmer {
    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 10px gold);
    }
    50% {
        filter: brightness(1.5) drop-shadow(0 0 20px gold);
    }
}

@keyframes diamondAppear {
    0% {
        transform: scale(0.5) rotate(-10deg);
        opacity: 0.2;
    }
    20% {
        transform: scale(1.1) rotate(2deg);
        opacity: 1;
    }
    40% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0;
    }
}